// const url=require('url')
// let href = 'https://new.qq.com/omn/20210516/20210516A09D5P00.html?id=100#hash'
// let href = '//new.qq.com/omn/20210516/20210516A09D5P00.html?id=100#hash'
// let href = '/omn/20210516/20210516A09D5P00.html?id=100#hash'
// console.log(url.parse(href));
// console.log(url.parse(href,true,true));




// let href = 'https://new.qq.com/omn/20210516/20210516A09D5P00.html?id=100&name=lisi#hash'
// const url =new URL(href)
// // console.log(url.searchParams)
// // console.log(url.searchParams.get('id'))
// // console.log(url.searchParams.get('name'))

// // console.log(url.searchParams.getAll('name'))

// for(let [key,value] of url.searchParams.entries()){
//     console.log(key,value)
// }

 let href = '?id=100&name=lisi#hash'
const query = new URLSearchParams(href)
// search对象 key => value
console.log(query); 
